using Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace ELF.Infrastructure.Data.Configurations;

public class AnswerConfiguration : IEntityTypeConfiguration<Answer>
{
    public void Configure(EntityTypeBuilder<Answer> builder)
    {
        builder.HasKey(t => t.Id);
        builder.Property(t => t.Id).ValueGeneratedNever();

        builder.Property(t => t.Content)
        .HasMaxLength(5000)
        .IsRequired()
        ;

        builder.Property(t => t.UserId)
        .HasMaxLength(50)
        .IsRequired()
        ;
        builder.Property(t => t.UserDisplayName)
        .HasMaxLength(1000)
        .IsRequired()
        ;
    }
}